﻿using IService;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Logging;
using Model;

namespace WMS.Controllers
{
    public class CreateMenuController : Controller
    {
        public ICJurisdictionService _icjs;
        public CreateMenuController(ICJurisdictionService icjs)
        {
            _icjs = icjs ?? throw new ArgumentNullException(nameof(icjs));
        }
        /// <summary>
        /// 加载菜单
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> CreateMenu(int uid)
        {
            int rolesID = await _icjs.GetRolesIDByUsersID(uid);
            List<CJurisdiction> list = await _icjs.GetMainMenu(rolesID);
            return Json(list);
        }
    }
}
